inherit allarch and use RDEPENDS
I just stumbled on the mail below and it raised some questions:
Quoted 13 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Martin Jansa
Sent: den 22 augusti 2016 16:21
To: [email protected]; Joe Slater
Cc: [email protected]
Subject: Re: [OE-core] [oe-commits] [openembedded-core] 01/02: systemd-
compat-units:pkg_postinst()does not workQuoted 1 line · On Thu, Aug 18, 2016 at 03:52:33PM +0000, [email protected] wrote:
rpurdie pushed a commit to branch master in repository openembedded-core.
[cut]
Quoted 7 lines
Review
Quoted 2 lines
(quoted diff) +1
-1-RDPEPENDS_${PN} = "systemd" +RDEPENDS_${PN} = "systemd"This is good typo fix, but also causes allarch systemd-compat-units to RDEPENDS on
TUNE_PKGARCHsystemd as reported in:
http://lists.openembedded.org/pipermail/openembedded-core/2016-August/125483.html
Quoted 5 lines
So either please exclude it in layer.conf or drop this runtime dependency completely.
--
Martin 'JaMa' Jansa jabber: [email protected]
This is the first I heard about limits to recipes that inherit allarch and also use RDEPENDS. So after I read the above, I went and read the documentation for the allarch class, which unfortunately did not make my understanding much clearer.
Am I to understand that a recipe that inherits allarch cannot have runtime dependencies on packages that are built differently per architecture or MACHINE? If so, what can it have runtime dependencies on? Only other allarch recipes? What are the design limitations behind this and is there anything that could be done to change the situation?
As an example, say that I have a recipe that only installs a static script, so inheriting allarch is a natural thing to do. However, for this script to work it must call a binary built by another recipe so it of course RDEPENDS on that other package. Are you saying this is wrong? Because that sounds odd to me as it severely limits the usefulness of the allarch class.
Another example would be a recipe that installs a static Perl script. Can it not inherit allarch while also have a runtime dependency on perl?
If the above is true, why are there no QA tests or similar that catch these kind of problems?
//Peter
Quoted 6 lines · Peter Kjellerstedt
This is the first I heard about limits to recipes that inherit allarch
and also use RDEPENDS. So after I read the above, I went and read the documentation for the allarch class, which unfortunately did not make my understanding much clearer.
Quoted 6 lines
Am I to understand that a recipe that inherits allarch cannot have runtime dependencies on packages that are built differently per architecture or MACHINE? If so, what can it have runtime dependencies on? Only other allarch recipes? What are the design limitations behind this and is there anything that could be done to change the situation?
It can depend on them, only if you add it to the list of dependencies in layer.conf, either SIGGEN_EXCLUDERECIPES_ABISAFE or
SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS. The implication of that is that if
one of these recipes changes, the dependency will not be rebuilt, so you have to be careful about things like these packages getting renamed.
Its basically a choice, we can have allarch packages and accept we can't always rebuild them through the sstate hash changes, or we don't have allarch packages at all (or have packages that can't have non -allarch dependencies).
Quoted 6 lines
As an example, say that I have a recipe that only installs a static script, so inheriting allarch is a natural thing to do. However, for this script to work it must call a binary built by another recipe so it of course RDEPENDS on that other package. Are you saying this is wrong? Because that sounds odd to me as it severely limits the usefulness of the allarch class.
You can do this if and only if you list it in layer.conf.
Quoted 6 lines
Another example would be a recipe that installs a static Perl script. Can it not inherit allarch while also have a runtime dependency on perl?
If the above is true, why are there no QA tests or similar that catch these kind of problems?
We do have sstate hash tests in oe-selftest which would highlight such a problem.
There are various open bugs complaining about this situation however I've yet to come up with a way which solves the problem perfectly, much as I'd like to.
Cheers,
Richard
Quoted 21 lines · Richard Purdie
Quoted 6 lines · Peter Kjellerstedt
This is the first I heard about limits to recipes that inherit allarch
and also use RDEPENDS. So after I read the above, I went and read the documentation for the allarch class, which unfortunately did not make my understanding much clearer.Quoted 6 lines
Am I to understand that a recipe that inherits allarch cannot have runtime dependencies on packages that are built differently per architecture or MACHINE? If so, what can it have runtime dependencies on? Only other allarch recipes? What are the design limitations behind this and is there anything that could be done to change the situation?
It can depend on them, only if you add it to the list of dependencies in layer.conf, either
SIGGEN_EXCLUDERECIPES_ABISAFEorSIGGEN_EXCLUDE_SAFE_RECIPE_DEPS. The implication of that is that if one of these recipes changes, the dependency will not be rebuilt, so you have to be careful about things like these packages getting renamed.
Quoted 4 lines
Its basically a choice, we can have allarch packages and accept we can't always rebuild them through the sstate hash changes, or we don't have allarch packages at all (or have packages that can't have non -allarch dependencies).
First time I've heard about this limitation, I don't understand what's this about either. I've been telling people to put their arch or machine specific code into a seperate package and RDEPEND on it from an allarch package that holds the Python code that calls into that.
We haven't seen any problems with that.
So what is the bad thing that would happen if we don't set the SIGGEN_EXCLUDE... variables in the layer.conf file?
Quoted 16 lines
Quoted 6 lines
As an example, say that I have a recipe that only installs a static script, so inheriting allarch is a natural thing to do. However, for this script to work it must call a binary built by another recipe so it of course RDEPENDS on that other package. Are you saying this is wrong? Because that sounds odd to me as it severely limits the usefulness of the allarch class.
You can do this if and only if you list it in layer.conf.
Quoted 6 lines
Another example would be a recipe that installs a static Perl script. Can it not inherit allarch while also have a runtime dependency on perl?
If the above is true, why are there no QA tests or similar that catch these kind of problems?
Quoted 6 lines
We do have sstate hash tests in oe-selftest which would highlight such a problem.
There are various open bugs complaining about this situation however I've yet to come up with a way which solves the problem perfectly, much as I'd like to.
I'm totally in the dark as to what should go where now.
Given the situation above, a recipe called "static-perl-script.bb" that requires the "perl" interpreter, what should we put into layer.conf then?
Kind regards,
Mike Looijmans
System Expert
TOPIC Products
Materiaalweg 4
5681 RJ Best
T:
+31 (0) 499 33 69 69
Postbus 440
E:
[email protected]
5680 AK Best
W:
www.topicproducts.com
The Netherlands
Please consider the environment before printing this e-mail
Topic zoekt gedreven (embedded) software specialisten!
Quoted 10 lines · Mike Looijmans
First time I've heard about this limitation, I don't understand what's this about either. I've been telling people to put their arch or machine specific code into a seperate package and RDEPEND on it from an allarch package that holds the Python code that calls into that.
We haven't seen any problems with that.
So what is the bad thing that would happen if we don't set the
SIGGEN_EXCLUDE... variables in the layer.conf file?
If you have an allarch recipe X and you depend on a tune or machine specific package from it, what you'll see is that when you switch MACHINE (with a different tune), the recipe X will rebuild each time. This is obviously suboptimal however its not the end of the world. It is problematic if you're using PR server.
The reason it rebuilds is that its checksum has a dependency on something which is tune or machine specific, you change MACHINE, the checksum changes and the allarch recipe's checksum changes.
If we remove the dependency from the task checksum, the problem isn't there and it doesn't rebuild, however there are some circumstances where this could be an issue, e.g. if a dependency name was renamed by debian.bbclass for example.
The mechanism for removing such a dependency is the one I've mentioned in layer.conf.
You can see if you have a problem with your layers by running:
oe-selftest -r sstatetests.SStateTests.test_sstate_allarch_samesigs
Does that make the issue any clearer?
Related bugs:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=7298
https://bugzilla.yoctoproject.org/show_bug.cgi?id=8078
https://bugzilla.yoctoproject.org/show_bug.cgi?id=7724
Cheers,
Richard
Quoted 7 lines · Richard Purdie
Quoted 6 lines · Mike Looijmans
First time I've heard about this limitation, I don't understand what's this about either. I've been telling people to put their arch or machine specific code into a seperate package and RDEPEND on it from an allarch package that holds the Python code that calls into that.
Quoted 8 lines
Quoted 4 lines
We haven't seen any problems with that.
So what is the bad thing that would happen if we don't set the
SIGGEN_EXCLUDE... variables in the layer.conf file?If you have an allarch recipe X and you depend on a tune or machine specific package from it, what you'll see is that when you switch MACHINE (with a different tune), the recipe X will rebuild each time.
So it's just inefficient, but does not break things?
Quoted 2 lines
This is obviously suboptimal however its not the end of the world. It is problematic if you're using PR server.
Which brings me to the next question: What would go wrong then?
(PR server is somewhat mandatory today)
Quoted 9 lines
The reason it rebuilds is that its checksum has a dependency on something which is tune or machine specific, you change MACHINE, the checksum changes and the allarch recipe's checksum changes.
If we remove the dependency from the task checksum, the problem isn't there and it doesn't rebuild, however there are some circumstances where this could be an issue, e.g. if a dependency name was renamed by debian.bbclass for example.
Quoted 8 lines
The mechanism for removing such a dependency is the one I've mentioned in layer.conf.
You can see if you have a problem with your layers by running:
oe-selftest -r sstatetests.SStateTests.test_sstate_allarch_samesigs
Does that make the issue any clearer?
A bit. But I don't understand what I have to fill in where. Example:
mike@mikebuntu:~/.../recipes-spike/spike$ cat spikeall.bb
LICENSE="CLOSED"
inherit allarch
RDEPENDS_${PN} = "spikemach"
do_install() {
install -d ${D}${bindir}
echo 'cat ${sysconfdir}/hello' > ${S}/${PN}.sh
install -m 755 ${S}/${PN}.sh ${D}${bindir}
}
mike@mikebuntu:~/.../recipes-spike/spike$ cat spikemach.bb
LICENSE="CLOSED"
PACKAGE_ARCH="${MACHINE_ARCH}"
PV="2"
do_install() {
install -d ${D}${sysconfdir}
echo "${MACHINE}" > ${D}${sysconfdir}/hello
}I run "bitbake spikeall" and both packages get built.
I run "bitbake spikeall" and nothing builds (which is good)
Change the PV in spikemach.bb, and run "bitbake spikeall". Both spikemach and spikeall are built (which is the problem we're talking about then, spikeall needn't build again).
I add the following line to the layer.conf in that layer:
SIGGEN_EXCLUDERECIPES_ABISAFE += "spikeall"
No change, spikeall still gets rebuilt along with spikemach.
The other way around maybe?
SIGGEN_EXCLUDERECIPES_ABISAFE += "spikemach"
Now it appears to work. Changing spikemach no longer causes spikeall to rebuild.
I have no clue as to why this would be needed, but I'll take your word for it.
Why can't we just do SIGGEN_EXCLUDERECIPES_ABISAFE="1" in the spikemach.bb recipe? That's much easier to maintain and understand...
Kind regards,
Mike Looijmans
System Expert
TOPIC Products
Materiaalweg 4
5681 RJ Best
T:
+31 (0) 499 33 69 69
Postbus 440
E:
[email protected]
5680 AK Best
W:
www.topicproducts.com
The Netherlands
Please consider the environment before printing this e-mail
Topic zoekt gedreven (embedded) software specialisten!